using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace DigitalFortress {
	/// <summary>
	/// Application entity.
	/// </summary>
	[DataContract(Namespace = "http://digitalfortress.com", Name = "Application")]
	public partial class Application {

		#region Fields
		private System.Guid _applicationId;
		private string _name;
		private string _description;
		private string _email;
		private bool isBlocked;
		private DateTime createDate;
		private DateTime? blockedSince;
		private DateTime? unblockedSince;
		#endregion Fields

		#region Properties
		/// <summary>
		/// ApplicationId Property Name.
		/// </summary>
		public const string ApplicationIdProperty = "ApplicationId";
		/// <summary>
		/// Application Id.
		/// </summary>
		[DataMember(IsRequired = false, Name = ApplicationIdProperty, Order = 0)]
		public Guid ApplicationId {
			get {
				return this._applicationId;
			}
			set {
				this._applicationId = value;
			}
		}

		/// <summary>
		/// Name Property Name.
		/// </summary>
		public const string NameProperty = "Name";
		/// <summary>
		/// Name of the Application.
		/// </summary>
		[DataMember(IsRequired = false, Name = NameProperty, Order = 1)]
		public string Name {
			get {
				return this._name;
			}
			set {
				this._name = value;
			}
		}

		/// <summary>
		/// Description Property Name.
		/// </summary>
		public const string DescriptionProperty = "Description";
		/// <summary>
		/// Description of the Application.
		/// </summary>
		[DataMember(IsRequired = false, Name = DescriptionProperty, Order = 2)]
		public string Description {
			get {
				return this._description;
			}
			set {
				this._description = value;
			}
		}

		/// <summary>
		/// Email Property Name.
		/// </summary>
		public const string EmailProperty = "Email";
		/// <summary>
		/// E-mail of the responsible for managing this application. This information is needed for 
		/// password reseting purposes.
		/// </summary>
		[DataMember(IsRequired = true, Name = EmailProperty, Order = 3)]
		public string Email {
			get {
				return _email;
			}
			set {
				_email = value;
			}
		}

		/// <summary>
		/// CreateDate Property Name.
		/// </summary>
		public const string CreateDateProperty = "CreateDate";
		/// <summary>
		/// Indicates when this application was created. Defaults to DateTime.Now if not set.
		/// </summary>
		[DataMember(IsRequired = false, Name = CreateDateProperty, Order = 4)]
		public DateTime CreateDate {
			get {
				return createDate;
			}
			set {
				createDate = value;
			}
		}

		/// <summary>
		/// IsBlocked Property Name.
		/// </summary>
		public const string IsBlockedProperty = "IsBlocked";
		/// <summary>
		/// Indicates whether this application is blocked or not. This value is false when the
		/// application is created.
		/// </summary>
		[DataMember(IsRequired = true, Name = IsBlockedProperty, Order = 5)]
		public bool IsBlocked {
			get {
				return isBlocked;
			}
			set {
				isBlocked = value;
			}
		}

		/// <summary>
		/// BlockedSince Property Name.
		/// </summary>
		public const string BlockedSinceProperty = "BlockedSince";
		/// <summary>
		/// If the application is blocked, indicates when was the blocking date for this application.
		/// Otherwise this is null.
		/// This value defaults to null.
		/// </summary>
		[DataMember(IsRequired = false, Name = BlockedSinceProperty, Order = 6)]
		public DateTime? BlockedSince {
			get {
				return blockedSince;
			}
			set {
				blockedSince = value;
			}
		}

		/// <summary>
		/// UnblockedSince Property Name.
		/// </summary>
		public const string UnblockedSinceProperty = "UnblockedSince";
		/// <summary>
		/// If the application is unblocked, indicates when was the unblocking date for this application.
		/// Otherwise this is null.
		/// This value defaults to the CreateDate.
		/// </summary>
		[DataMember(IsRequired = false, Name = UnblockedSinceProperty, Order = 7)]
		public DateTime? UnblockedSince {
			get {
				return unblockedSince;
			}
			set {
				unblockedSince = value;
			}
		}
		#endregion Properties
	}
}
